package com.dhl.fin.api.enums;


import lombok.Getter;

import java.util.Arrays;

@Getter
public enum ReportDataTypeEnum {

    MONEY_RECORD(0, "流水记录数据"),

    FIX_MONEY_RECORD(1, "定期存款记录数据"),

    BUSINESS_MONEY_RECORD(2, "业务办理记录数据"),

    LEND_OUT_RECORD(3, "借出记录数据");

    private Integer index;

    private String name;

    ReportDataTypeEnum(Integer index, String name) {
        this.index = index;
        this.name = name;
    }

    public static ReportDataTypeEnum getByIndex(Integer index) {
        return Arrays.stream(ReportDataTypeEnum.values())
                .filter(reportDataTypeEnum -> reportDataTypeEnum.getIndex()
                        .equals(index)).findFirst().orElse(null);
    }

}


